﻿using DataAchive.Base;
using System;

namespace DataAchive.Model.ViewModels
{


    public class MultiCbxBaseData : ViewModelBase
    {
        private int _id;
        public int ID
        {
            get { return _id; }
            set
            {
                _id = value;
                OnPropertyChanged();
            }
        }

        private string _viewName;
        public string ViewName
        {
            get { return _viewName; }
            set
            {
                _viewName = value;
                OnPropertyChanged();
            }
        }

        private bool _isCheck;
        /// <summary>
        /// 是否选中
        /// </summary>
        public bool IsCheck
        {
            get { return _isCheck; }
            set
            {
                _isCheck = value;
                OnPropertyChanged();
                if (ID == -1) // SelectAll item
                {
                    ISCheckChanged?.Invoke(this, EventArgs.Empty);
                }
            }
        }

        public event EventHandler ISCheckChanged;

    }

}
